Skip to content

Port #[crate_name] to the new attribute parsing infrastructure #137729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 24, 2025

Conversation

jdonszelmann
Copy link
Contributor

@jdonszelmann jdonszelmann commented Feb 27, 2025

r? @fmease

Closes #137687

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 27, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jdonszelmann jdonszelmann force-pushed the fix-137687 branch 2 times, most recently from 4e90cee to 21838d5 Compare February 27, 2025 16:51
@jdonszelmann
Copy link
Contributor Author

@fmease and I decided to delay this PR for a bit until more diagnostic infra for attrs lands (hopefully next week) to make the duplicate error a warning to be consistent with current master.

@fmease fmease added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 6, 2025
@fmease
Copy link
Member

fmease commented Mar 6, 2025

r=fmease,bjorn3 once that PR lands and you can downgrade the error to a lint warning again.

@bors delegate+

@bors
Copy link
Collaborator

bors commented Mar 6, 2025

✌️ @jdonszelmann, you can now approve this pull request!

If @fmease told you to "r=me" after making some further change, please make that change, then do @bors r=@fmease

@bors

This comment was marked as resolved.

@wesleywiser
Copy link
Member

Hi @jdonszelmann and @fmease, #137687 has reached beta so it would be great if we could resolve that via a beta-backport of this PR. Do you think it's possible to resolve the review feedback and merge this PR in the next week or so?

I can probably pitch in to help if necessary 🙂

@jdonszelmann
Copy link
Contributor Author

Hi there. We wanted to delay this until attribute diagnostics. Something that should not be a lot of work but I have not worked as much on recently as I maybe should. I can't to this tomorrow, but likely next week. The pr has been reviewed but there was a bit of an issue around incremental, which I now know how to solve but just haven't yet. Is that a reasonable timeframe? I am pretty busy with organising rust week atm, but knowing the solution I guess the only important thing is that it gets quick reviews? Let me know how that sounds

@wesleywiser
Copy link
Member

Just to clarify, will this PR then depend on the attribute diagnostics work? (Is that #138164?)

Generally, for backports, we try to keep the backport as small as possible so if this PR can be made to work independently of that PR (possibly even with a degraded diagnostics experience), that would be highly preferred.

@jdonszelmann
Copy link
Contributor Author

No. We decided to delay this because it's relatively low prio and any nice and permanent solution for this depends on that. I'll make a temp fix that at least doesn't ice separately then, that sounds better for now. I don't mind doing it, I know the problem now and then I also know how to fix it permanently later. You'll hear from me

@theemathas
Copy link
Contributor

theemathas commented May 1, 2025

Note that #137687 actually has two separate problems/subissues:

  1. A problem (lower priority) involving the #[crate_name] attribute.
  2. A problem (higher priority, found in a crater run) involving user-defined macro_rules and derive macros.

This PR only appears to address the first problem. The second problem would probably need to have a separate fix.

@jdonszelmann
Copy link
Contributor Author

jdonszelmann commented May 2, 2025

ok this is weird, I've copied just the tests over to master to fix it in a temporary way, but can no longer reporoduce the issue. Something else must have solved it in the meantime. Let me see what.

@jieyouxu
Copy link
Member

jieyouxu commented May 3, 2025

(I know I've said this in the other PR too, but just in case)

Just a heads up: I split #137687 into two issues:

@fmease
Copy link
Member

fmease commented Aug 23, 2025

Amazing work, thank you!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 23, 2025

📌 Commit 9a7d66d has been approved by fmease

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 23, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 23, 2025
Port `#[crate_name]` to the new attribute parsing infrastructure

r? `@fmease`

Closes rust-lang#137687
@jhpratt
Copy link
Member

jhpratt commented Aug 24, 2025

merge conflicts

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 24, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@jdonszelmann
Copy link
Contributor Author

@bors r=fmease

@bors
Copy link
Collaborator

bors commented Aug 24, 2025

📌 Commit 48a4e2d has been approved by fmease

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 24, 2025
@bors
Copy link
Collaborator

bors commented Aug 24, 2025

⌛ Testing commit 48a4e2d with merge 93edf9f...

@bors
Copy link
Collaborator

bors commented Aug 24, 2025

☀️ Test successful - checks-actions
Approved by: fmease
Pushing 93edf9f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 24, 2025
@bors bors merged commit 93edf9f into rust-lang:master Aug 24, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 24, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 4eedad3 (parent) -> 93edf9f (this PR)

Test differences

Show 14 test diffs

Stage 1

  • [ui] tests/ui/lint/unused/concat-in-crate-deprecated-issue-137687.rs: [missing] -> pass (J1)
  • [ui] tests/ui/lint/unused/concat-in-crate-name-issue-137687.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/lint/unused/concat-in-crate-deprecated-issue-137687.rs: [missing] -> pass (J0)
  • [ui] tests/ui/lint/unused/concat-in-crate-name-issue-137687.rs: [missing] -> pass (J0)

Additionally, 10 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 93edf9f9b0bf284d8f8cbe52af5d0569d0cf5850 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-linux: 6292.7s -> 9447.7s (50.1%)
  2. pr-check-1: 1377.3s -> 1612.4s (17.1%)
  3. i686-gnu-2: 5542.5s -> 6348.7s (14.5%)
  4. aarch64-gnu-llvm-19-1: 3303.4s -> 3771.2s (14.2%)
  5. x86_64-gnu-miri: 4523.6s -> 5090.9s (12.5%)
  6. dist-apple-various: 4610.1s -> 4043.7s (-12.3%)
  7. dist-aarch64-apple: 6558.8s -> 5792.5s (-11.7%)
  8. x86_64-gnu-llvm-19: 2518.5s -> 2800.5s (11.2%)
  9. x86_64-gnu-stable: 6924.7s -> 7649.4s (10.5%)
  10. x86_64-rust-for-linux: 2590.4s -> 2855.4s (10.2%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@jdonszelmann
Copy link
Contributor Author

yay, finally!

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (93edf9f): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -1.1%, secondary 1.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.7% [2.0%, 3.3%] 7
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
-3.6% [-3.6%, -3.6%] 1
All ❌✅ (primary) -1.1% [-1.1%, -1.1%] 1

Cycles

Results (secondary 4.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.3% [4.3%, 4.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 467.477s -> 468.299s (0.18%)
Artifact size: 378.32 MiB -> 378.33 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: expr in place where literal is expected (builtin attr parsing)